package com.xiaohudie.Factory;

import com.xiaohudie.entity.Car;

import java.util.HashMap;
import java.util.Map;

public class IntastCarFactory {
    private static Map<Integer, Car> carMap;
   public IntastCarFactory() {
        carMap =new HashMap<Integer, Car>();
        carMap.put(1,new Car(1,"奥迪"));
        carMap.put(2,new Car(2,"奔驰"));
    }
    public  Car getCar(Integer num){
        return carMap.get(num);
    }
}
